-
-
Notifications
You must be signed in to change notification settings - Fork 32
fix: ensure critical process methods are properly implemented #123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Restore process.nextTick functionality instead of noop - Implement process.versions.node using navigator.userAgent - Maintain process.emitWarning functionality This patch ensures better compatibility with Node.js process polyfills in browser environments.
"version": "0.23.0", | ||
"version": "0.23.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bump package versions after merging into the main
branch. Please remove this change.
process.prependListener = noop; | ||
process.prependOnceListener = noop; | ||
+process.emitWarning = noop; | ||
+process.nextTick = noop; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will cause libs checking process.nextTick
presence and using it with a fallback to setImmediate / setTimeout to fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An implementation is even present in https://www.npmjs.com/package/process, why reset it to noop?
@@ -1,4 +1,4 @@ | |||
lockfileVersion: '9.0' | |||
lockfileVersion: '6.0' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why
process.version = ''; // empty string to avoid regexp issues | ||
-process.versions = {}; | ||
+process.versions = { | ||
+ node: typeof navigator !== 'undefined' ? navigator.userAgent.split('/').pop() : '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if reporting e.g. '537.36'
as Node.js version is reasonable over e.g. some hardcoded one?
Also, it won't parse as major.minor.patch
This patch ensures better compatibility with Node.js process polyfills in browser environments.